3.296 \(\int \sec ^2(e+f x) (a+b \sin ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=51 \[ \frac{(a+b)^2 \tan (e+f x)}{f}-\frac{1}{2} b x (4 a+3 b)+\frac{b^2 \sin (e+f x) \cos (e+f x)}{2 f} \]

[Out]

-(b*(4*a + 3*b)*x)/2 + (b^2*Cos[e + f*x]*Sin[e + f*x])/(2*f) + ((a + b)^2*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0892798, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {3191, 390, 385, 203} \[ \frac{(a+b)^2 \tan (e+f x)}{f}-\frac{1}{2} b x (4 a+3 b)+\frac{b^2 \sin (e+f x) \cos (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

-(b*(4*a + 3*b)*x)/2 + (b^2*Cos[e + f*x]*Sin[e + f*x])/(2*f) + ((a + b)^2*Tan[e + f*x])/f

Rule 3191

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sec ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+(a+b) x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left ((a+b)^2-\frac{b (2 a+b)+2 b (a+b) x^2}{\left (1+x^2\right )^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a+b)^2 \tan (e+f x)}{f}-\frac{\operatorname{Subst}\left (\int \frac{b (2 a+b)+2 b (a+b) x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{b^2 \cos (e+f x) \sin (e+f x)}{2 f}+\frac{(a+b)^2 \tan (e+f x)}{f}-\frac{(b (4 a+3 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{1}{2} b (4 a+3 b) x+\frac{b^2 \cos (e+f x) \sin (e+f x)}{2 f}+\frac{(a+b)^2 \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.318603, size = 48, normalized size = 0.94 \[ \frac{-2 b (4 a+3 b) (e+f x)+4 (a+b)^2 \tan (e+f x)+b^2 \sin (2 (e+f x))}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

(-2*b*(4*a + 3*b)*(e + f*x) + b^2*Sin[2*(e + f*x)] + 4*(a + b)^2*Tan[e + f*x])/(4*f)

________________________________________________________________________________________

Maple [A]  time = 0.06, size = 87, normalized size = 1.7 \begin{align*}{\frac{1}{f} \left ({a}^{2}\tan \left ( fx+e \right ) +2\,ab \left ( \tan \left ( fx+e \right ) -fx-e \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{5}}{\cos \left ( fx+e \right ) }}+ \left ( \left ( \sin \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\sin \left ( fx+e \right ) }{2}} \right ) \cos \left ( fx+e \right ) -{\frac{3\,fx}{2}}-{\frac{3\,e}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*tan(f*x+e)+2*a*b*(tan(f*x+e)-f*x-e)+b^2*(sin(f*x+e)^5/cos(f*x+e)+(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*
x+e)-3/2*f*x-3/2*e))

________________________________________________________________________________________

Maxima [A]  time = 1.48159, size = 100, normalized size = 1.96 \begin{align*} -\frac{4 \,{\left (f x + e - \tan \left (f x + e\right )\right )} a b +{\left (3 \, f x + 3 \, e - \frac{\tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1} - 2 \, \tan \left (f x + e\right )\right )} b^{2} - 2 \, a^{2} \tan \left (f x + e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/2*(4*(f*x + e - tan(f*x + e))*a*b + (3*f*x + 3*e - tan(f*x + e)/(tan(f*x + e)^2 + 1) - 2*tan(f*x + e))*b^2
- 2*a^2*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.85229, size = 159, normalized size = 3.12 \begin{align*} -\frac{{\left (4 \, a b + 3 \, b^{2}\right )} f x \cos \left (f x + e\right ) -{\left (b^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} + 4 \, a b + 2 \, b^{2}\right )} \sin \left (f x + e\right )}{2 \, f \cos \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*((4*a*b + 3*b^2)*f*x*cos(f*x + e) - (b^2*cos(f*x + e)^2 + 2*a^2 + 4*a*b + 2*b^2)*sin(f*x + e))/(f*cos(f*x
 + e))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**2*(a+b*sin(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.13218, size = 134, normalized size = 2.63 \begin{align*} \frac{2 \, a^{2} \tan \left (f x + e\right ) + 4 \, a b \tan \left (f x + e\right ) + 2 \, b^{2} \tan \left (f x + e\right ) -{\left (4 \, a b + 3 \, b^{2}\right )}{\left (f x - \pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + e\right )} + \frac{b^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*(2*a^2*tan(f*x + e) + 4*a*b*tan(f*x + e) + 2*b^2*tan(f*x + e) - (4*a*b + 3*b^2)*(f*x - pi*floor((f*x + e)/
pi + 1/2) + e) + b^2*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f